package site.syso.controller;

import java.util.HashMap;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Configuration
@RestController
@RequestMapping("/spring-boot-apollo")
public class ApolloController {

    @Value("${key.test}")
    private String keyTest;

    @Autowired
    private StringRedisTemplate redisTemplate;


    @RequestMapping
    public Map<String, Object> test() {
        return new HashMap<String, Object>() {{
            this.put("keyTest", keyTest);
            this.put("redisTest", redisTemplate.opsForSet().members("tax-bbs-spider:jd"));
        }};
    }

}
